package com.lkdont.android.base.ui

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

/**
 * Activity基类
 *
 * @author lqd
 */
abstract class BaseAct : AppCompatActivity(), UserInterface {

    override fun getContext(): Context? {
        return this
    }

    override fun requireContext(): Context {
        return this
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        // 让BaseActManager对这个Act进行管理
        BaseActManager.instance.add(this)
    }

    override fun onDestroy() {
        super.onDestroy()
        // 移除BaseActManager对这个Act的管理
        BaseActManager.instance.remove(this)
    }

    override fun startActivityForResult(intent: Intent?, requestCode: Int, options: Bundle?) {
        super.startActivityForResult(intent, requestCode, options)
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
    }
}